<!DOCTYPE html>
<html lang="zxx">

<head>
    <meta charset="utf-8" />
    <meta http-equiv="x-ua-compatible" content="ie=edge" />
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <title>NY·房屋租赁社区-房源详情</title>
    <link rel="shortcut icon" href="assets/img/favicon.png" type="img/png" />
    <link rel="stylesheet" href="assets/css/animate.min.css">
    <link rel="stylesheet" href="assets/css/bootstrap.min.css" />
    <link rel="stylesheet" href="assets/css/font-awesome.min.css" />
    <link rel="stylesheet" href="assets/css/flaticon.css" />
    <link rel="stylesheet" href="assets/css/magnific-popup.css" />
    <link rel="stylesheet" href="assets/css/slick.css" />
    <link rel="stylesheet" href="assets/css/nice-select.css" />
    <link rel="stylesheet" href="assets/css/leaflet.css" />
    <link rel="stylesheet" href="assets/css/mapbox-gl.min.css" />
    <link rel="stylesheet" href="assets/css/bootstrap-datepicker.css" />
    <link rel="stylesheet" href="assets/css/default.css" />
    <link rel="stylesheet" href="assets/css/style.css" />
    <link rel="stylesheet" href="assets/css/alert.css">
    <style type="text/css">
        select {
            appearance:none;
            -moz-appearance:none;
            -webkit-appearance:none;
        }
    </style>
</head>

<body>

<!-- 头部开始 -->
<div class="preloader d-flex align-items-center justify-content-center">
    <div class="cssload-container">
        <div class="cssload-loading"><i></i><i></i><i></i><i></i></div>
    </div>
</div>

<header class="header-absolute sticky-header">
    <div class="container container-custom-one">
        <div class="nav-container d-flex align-items-center justify-content-between">

            <div class="nav-menu d-lg-flex align-items-center">


                <div class="navbar-close">
                    <div class="cross-wrap"><span class="top"></span><span class="bottom"></span></div>
                </div>


                <div class="toggle">
                    <a href="#" id="offCanvasBtn"><i class="fal fa-bars"></i></a>
                </div>

                <div class="menu-items">
                    <ul>
                        <li>
                            <a href="index.html">主页</a>
                        </li>
                        <li>
                            <a href="apartment-grid.html">我要找房</a>
                        </li>
                        <li>
                            <a href="classification.html">房源类型</a>
                        </li>
                        <li>
                            <a href="places.html">地图找房</a>
                        </li>
                        <li><a href="news.html">社区文化</a>

                        </li>
                    </ul>
                </div>


                <div class="nav-pushed-item"></div>
            </div>


            <div class="site-logo">
                <a href="index.html"><img src="assets/img/logo.png" alt="Logo"></a>
            </div>


            <div class="nav-push-item">

                <div class="header-info d-lg-flex align-items-center">
                    <div class="item">
                        <i class="fal fa-phone"></i>
                        <span>联系我们</span>
                        <a href="tel:+90898787709">
                            <h5 class="title">+1565 5757 567</h5>
                        </a>
                    </div>
                    <div class="item">
                        <i class="fal fa-envelope"></i>
                        <span>客服邮箱</span>
                        <a href="mailto:info@webmail.com">
                            <h5 class="title">jiajia@webmail.com</h5>
                        </a>
                    </div>
                </div>
            </div>

            <div class="navbar-toggler">
                <span></span><span></span><span></span>
            </div>
        </div>
    </div>
</header>

<div class="offcanvas-wrapper">
    <div class="offcanvas-overly"></div>
    <div class="offcanvas-widget">
        <a href="#" class="offcanvas-close"><i class="fal fa-times"></i></a>
        <div class="widget search-widget">
            <h5 class="widget-title">搜 房</h5>
            <form>
                <input type="text" id="content1" placeholder="请输入关键词">
                <button type="button" id="search1"><i class="far fa-search"></i></button>
            </form>
        </div>

        <div class="widget about-widget">
            <h5 class="widget-title">关于我们</h5>
            <p>
                NYCONDOS APARTMENTS·房屋租赁社区简称NY·房屋租赁社区，隶属于河南省郑州市-郑州航空工业管理学院-佳佳有限公司。2021年成立于河南郑州，
                是由郑州航院佳佳有限公司与江苏南京欣媚投资管理有限公司联合成立的郑州住房租赁行业第一家合资企业，是专注于为追求
                丰富生活体验的城市精英租房群体服务的集中式长租公寓连锁运营商。NY·房屋租赁社区致力于为租房人群提供完备的公寓产品，
                打造温馨的文化社区，以多样化的社群场景，为有态度的租房一族带来花样生活。
            </p>
        </div>

        <div class="widget nav-widget">
            <h5 class="widget-title">浏览导航</h5>
            <ul>
                <li><a href="index.html">主页</a></li>
                <li>
                    <a href="trending.html">我要找房</a>
                </li>
                <li>
                    <a href="classification.html">房源类型</a>
                </li>
                <li>
                    <a href="places.html">地图找房</a>
                </li>
                <li><a href="news.html">社区文化</a>

                </li>
            </ul>
        </div>

        <div class="widget social-link">
            <h5 class="widget-title">联系我们</h5>
            <ul>
                <li><a href="#"><i class="fab fa-facebook-f"></i></a></li>
                <li><a href="#"><i class="fab fa-twitter"></i></a></li>
                <li><a href="#"><i class="fab fa-behance"></i></a></li>
                <li><a href="#"><i class="fab fa-linkedin"></i></a></li>
                <li><a href="#"><i class="fab fa-google"></i></a></li>
            </ul>
        </div>
    </div>
</div>
<!-- 头部结束 -->


<section class="breadcrumb-area" style="background-image: url(assets/img/bg/04.jpg);">
    <div class="container">
        <div class="breadcrumb-text">
            <span>NYCONDOS APARTMENTS</span>
            <h2 class="page-title">NY·房屋租赁社区</h2>

            <ul class="breadcrumb-nav">
                <li><a href="index.html">主页</a></li>
                <li class="active">房源详情</li>
            </ul>
        </div>
    </div>
</section>


    <section class="room-details pt-120 pb-90">
        <div class="container">
            <div class="row">

                <div class="col-lg-8">
                    <div class="deatils-box">
                        <div class="title-wrap" id="title">

                        </div>
                        <div class="thumb" id="houseUrl">

                        </div>
                        <p id="introduce">

                        </p>

                        <div class="room-fearures clearfix mt-60 mb-60" id="roomIcon">

                        </div>
                        <p id="roomDetail">

                        </p>
                        <div class="testimonials mt-60 mb-20">
                            <div class="row" id="head">



                            </div>
                        </div>
                        <div class="room-rules clearfix mb-60" id="roomRule">

                        </div>
                        <div class="cancellation-box clearfix mb-60" id="history">

                        </div>

                        <div class="room-map mb-60" id="roomMap"></div>

                        <div class="related-room" id="sameCity">


                        </div>
                    </div>
                </div>

                <div class="col-lg-4" id="order">

                </div>
            </div>
        </div>
    </section>


    <a href="#" class="back-to-top" id="backToTop">
        <i class="fal fa-angle-double-up"></i>
    </a>


<footer>

    <div class="copyright-area pt-20 pb-20">
        <div class="container">
            <div class="row align-items-center">
                <div class="col-md-5 order-2 order-md-1">
                    <p class="copyright-text">Copyright 安思佳©版权所有 2017-2021</p>
                </div>
                <div class="col-md-7 order-1 order-md-2">
                    <div class="social-links">
                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                        <a href="#"><i class="fab fa-twitter"></i></a>
                        <a href="#"><i class="fab fa-behance"></i></a>
                        <a href="#"><i class="fab fa-linkedin"></i></a>
                        <a href="#"><i class="fab fa-youtube"></i></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</footer>


    <script src="assets/js/vendor/modernizr-3.6.0.min.js"></script>
    <script src="assets/js/vendor/jquery-1.12.4.min.js"></script>
    <script src="assets/js/popper.min.js"></script>
    <script src="assets/js/slick.min.js"></script>
    <script src="assets/js/isotope.pkgd.min.js"></script>
    <script src="assets/js/jquery.magnific-popup.min.js"></script>
    <script src="assets/js/jquery.inview.min.js"></script>
    <script src="assets/js/jquery.countTo.js"></script>
    <script src="assets/js/jquery.nice-select.min.js"></script>
    <script src="assets/js/wow.min.js"></script>
  	<script src="assets/js/leaflet.js"></script>
  	<script src="assets/js/mapbox-gl.min.js"></script>
  	<script src="assets/js/map.js"></script>
    <script src="assets/js/main.js"></script>
    <script src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=he4Zb8V9WZ82BK5yoMPZrQEnzEchNAXp"></script>
    <script src="assets/js/bootstrap-datepicker.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/alert.js"></script>
    <script type="text/javascript">

        var roomId = getUrlParam("roomId");


        if (roomId == null || roomId == " ") {
            location.href = "index.html";
        }

        accessHits(roomId);

        getRoomDetail(roomId);

        getSameCity(roomId);

        roomMap(roomId);

        getHead(roomId);

        function getRoomDetail(roomId) {
            $.ajax({
                url: 'house-room-detail',
                data: {
                    roomId: roomId
                },
                type: 'get',
                dataType: 'json',
                success: function (result) {
                    if (result.code == 200) {
                        detailAppend(result);
                    }else {
                        location.href = "index.html";
                    }
                }
            });
        }

        function detailAppend(result) {
            $("#title").html("");
            $("#houseUrl").html("");
            $("#introduce").html("");
            $("#roomIcon").html("");
            $("#roomDetail").html("");
            $("#history").html("");

            var houseRoom = result.data.houseRoom;
            var houseRoomDetail = result.data.houseRoomDetail;
            var houseRoomResource = result.data.houseRoomResource;
            var houseSubscribe = result.data.subscribeVO;

            var category = "";
            switch (houseRoom.type) {
                case 1 : category = "复式"; break;
                case 2 : category = "别墅"; break;
                case 3 : category = "园景房"; break;
                case 4 : category = "阁楼"; break;
                case 5 : category = "单元式"; break;
                case 6 : category = "公寓式";
            }

            $("#title").append("<div class=\"title\">\n" +
                "                                <div class=\"room-cat\">"+ category +"</div>\n" +
                "                                <h2>"+ houseRoom.name +"</h2>\n" +
                "                            </div>\n" +
                "                            <div class=\"price\">\n" +
                "                                ￥"+ houseRoom.price +"<span>/月</span>\n" +
                "                            </div>");

            $("#houseUrl").append("<img width='770px' height='490px' src='"+ houseRoom.url +"' alt=\"images\">");

            $("#introduce").append("【房源简介】："+ houseRoom.introduce +"" +
                "<br/>【户型介绍】："+ houseRoomResource.houseType +"&nbsp;&nbsp;"+ houseRoomResource.houseArea +""+
                "</br>【门店地址】："+ houseRoomDetail.province +"&nbsp;&nbsp;"+ houseRoomDetail.city +"&nbsp;&nbsp;"+ houseRoomDetail.address +"&nbsp;&nbsp;<a href='#roomMap'><img src='assets/img/icon/geo-alt.svg' alt='地图' width='24' height='24'>地图</a>" +
                "<br/>【周边交通】："+ houseRoomDetail.traffic +"" +
                "<br/>【租赁时间】："+ houseRoom.onTime +" 至 "+ houseRoom.offTime +""  +
                "<br/>【租赁方式】："+ houseRoomDetail.payType +"&nbsp;&nbsp;可住"+ houseRoom.live +"人");

            $("#roomIcon").append("<h3 class=\"subtitle\">配套设施</h3>\n" +
                "                            <ul class=\"room-fearures-list\">\n" +
                "                                <li><i class=\"fal fa-bath\"></i>独立卫生间</li>\n" +
                "                                <li><i class=\"fal fa-wifi\"></i>免费WIFI</li>\n" +
                "                                <li><i class=\"fal fa-key\"></i>智能门锁</li>\n" +
                "                                <li><i class=\"fal fa-cut\"></i>精致装修</li>\n" +
                "                                <li><i class=\"fal fa-broom\"></i>上门保洁</li>\n" +
                "                                <li><i class=\"fal fa-shower\"></i>24h热水</li>\n" +
                "                                <li><i class=\"fal fa-headphones-alt\"></i>隔音降噪</li>\n" +
                "                                <li><i class=\"fal fa-shopping-basket\"></i>购物方便</li>\n" +
                "                                <li><i class=\"fal fa-bed\"></i>舒适大床</li>\n" +
                "                                <li><i class=\"fal fa-users\"></i>家庭聚餐</li>\n" +
                "                                <li><i class=\"fal fa-shopping-cart\"></i>临近商圈</li>\n" +
                "                                <li><i class=\"fal fa-bus\"></i>交通便利</li>\n" +
                "                            </ul>");

            $("#roomDetail").append("【大众点评】："+ houseRoomDetail.detail +"");

            $("#roomRule").append("<h3 class=\"subtitle\">房源信息</h3>\n" +
                "                            <ul class=\"room-rules-list\">\n" +
                "                                <li>"+ houseRoomDetail.village +"&nbsp;&nbsp;<a href='#roomMap'><img src='assets/img/icon/geo-alt.svg' alt='地图' width='24' height='24'>地图</a></li>\n" +
                "                                <li>"+ houseRoomResource.houseType +"</li>\n" +
                "                                <li>"+ houseRoomResource.houseArea +"</li>\n" +
                "                                <li>"+ houseRoomDetail.orientation +"</li>\n" +
                "                                <li>"+ houseRoomDetail.floor +"</li>\n" +
                "                            </ul>");

            if (houseSubscribe.count == 0) {
                $("#history").append("<h3 class=\"subtitle\">房源预约记录</h3>\n" +
                    "                            <p>\n" +
                    "                                该房源最近30天被预约过<strong>&nbsp;&nbsp;0&nbsp;&nbsp;</strong>次<br/>" +
                    "                                最近暂无预约记录" +
                    "                            </p>");
            }else {
                $("#history").append("<h3 class=\"subtitle\">房源预约记录</h3>\n" +
                    "                            <p>\n" +
                    "                                该房源最近30天被预约过<strong>&nbsp;&nbsp;"+ houseSubscribe.count +"&nbsp;&nbsp;</strong>次<br/>" +
                    "                                最近一次预约是在<strong>&nbsp;&nbsp;"+ houseSubscribe.date +"</strong>" +
                    "                            </p>");
            }


        }



        function getSameCity(roomId) {
            $.ajax({
                url: 'house-room/same',
                data: {
                    roomId: roomId
                },
                type: 'get',
                dataType: 'json',
                success: function (result) {
                    if (result.code == 200) {
                        sameCityAppend(result);
                    }
                }
            });
        }

        function sameCityAppend(result) {
            $("#sameCity").html("");

            $("#sameCity").append("<h3 class=\"subtitle\">同城推荐</h3>" +
                "<div class=\"row room-gird-loop\" id=\"sameCityRoom\">\n" +
                "\n" +
                "                            </div>");

            var houseRoomList = result.data;
            for (var i = 0; i < houseRoomList.length; i++) {
                var item = houseRoomList[i];
                $("#sameCityRoom").append("<div class=\"col-lg-6 col-sm-6\">\n" +
                    "                                    <div class=\"room-box mb-30\">\n" +
                    "                                        <div class=\"room-img-wrap\">\n" +
                    "                                            <div class=\"room-img\"\n" +
                    "                                                style=\"background-image: url("+ item.url +");\">\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                        <div class=\"room-desc\">\n" +
                    "                                            <ul class=\"icons\">\n" +
                    "                                                <li><i class=\"fal fa-bed\"></i></li>\n" +
                    "                                                <li><i class=\"fal fa-wifi\"></i></li>\n" +
                    "                                                <li><i class=\"fal fa-car\"></i></li>\n" +
                    "                                                <li><i class=\"fal fa-coffee\"></i></li>\n" +
                    "                                                <li><i class=\"fal fa-concierge-bell\"></i></li>\n" +
                    "                                                <li><i class=\"fal fa-compress-arrows-alt\"></i></li>\n" +
                    "                                                <li><i class=\"fal fa-swimmer\"></i></li>\n" +
                    "                                            </ul>\n" +
                    "                                            <h4 class=\"title\"><a onclick='goHref("+ item.id +")' href=\"javascript:void(0);\">"+ item.name +"</a></h4>\n" +
                    "                                            <p>"+ item.introduce +"</p>\n" +
                    "                                            <span class=\"price\">￥"+ item.price +"/月</span>\n" +
                    "                                            <a onclick='goHref("+ item.id +")' href=\"javascript:void(0);\" class=\"book-btn\">查看详情</a>\n" +
                    "                                        </div>\n" +
                    "                                    </div>\n" +
                    "                                </div>");
            }

        }


        function roomMap(roomId) {
            $.ajax({
                url: 'house-room-map/room',
                data: {
                    roomId: roomId
                },
                type: 'get',
                success:function (result) {
                    if (result.code == 200) {
                        getMap(result.data);
                    }
                }
            });
        }

        function getMap(item) {
            var map = new BMapGL.Map('roomMap');
            map.centerAndZoom(new BMapGL.Point(item.longitude, item.latitude), 18);
            map.enableScrollWheelZoom(true);
            // 创建添加点标记
            var marker = new BMapGL.Marker(new BMapGL.Point(item.longitude, item.latitude));
            map.addOverlay(marker);
            // 创建图文信息窗口
            var sContent = "<div style='width: 420px'><h4 style='margin:0 0 5px 0;'>"+ item.name +"</h4>\n" +
                "<img style='float:right;margin:0 4px 22px' id='imgDemo' src='"+ item.url +"' width='139' height='104'/>\n" +
                "<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>"+ item.tips +"</p></div>";
            var infoWindow = new BMapGL.InfoWindow(sContent);
            // marker添加点击事件
            marker.addEventListener('click', function () {
                this.openInfoWindow(infoWindow);
                // 图片加载完毕重绘infoWindow
                document.getElementById('imgDemo').onload = function () {
                    infoWindow.redraw(); // 防止在网速较慢时生成的信息框高度比图片总高度小，导致图片部分被隐藏
                };
            });
        }


        function getHead(roomId) {
            $.ajax({
                url: 'house-intermediary/list',
                data: {
                    roomId: roomId
                },
                type: 'get',
                dataType: 'json',
                success:function (result) {
                    if (result.code == 200) {
                        getHeadAppend(result);
                    }
                }
            });
        }

        function getHeadAppend(result) {
            $("#head").html("");
            $("#order").html("");

            var headList = result.data.houseIntermediaryList;

            var option = "";

            for (var i = 0; i < headList.length; i++) {
                var item = headList[i];
                var sex = "";
                switch (item.sex) {
                    case 1 : sex = "男"; break;
                    case 2 : sex = "女";
                }

                $("#head").append("<div class=\"col-lg-6 col-sm-6\">\n" +
                    "                                    <div class=\"testimonial-box\">\n" +
                    "                                        <div class=\"client-img\">\n" +
                    "                                            <img src=\""+ item.url +"\"  alt=\"images\">\n" +
                    "                                            <span class=\"check\"><i class=\"fal fa-check\"></i></span>\n" +
                    "                                        </div>\n" +
                    "                                        <h3>"+ item.name +"</h3>\n" +
                    "                                        <span class=\"clinet-post\">"+ item.province +", "+ item.city +".</span>\n" +
                    "                                        <p>\n" +
                    "                                            "+ item.name +", "+ sex +", <strong>"+ item.integral +"</strong> 年工作经验.<br/>\n" +
                    "                                            联系方式：<strong>"+ item.mobile +"</strong>.\n" +
                    "                                        </p>\n" +
                    "                                    </div>\n" +
                    "                                </div>");

                option = option + "<option value='"+ item.id +"'>"+ item.name +"</option>";

            }
            var guest = "";
            var live = result.data.live;

            for (var i = 1; i <= live; i++) {
                guest = guest + "<option value='"+ i +"'>"+ i +"</option>";
            }

            var min = getTomorrowDate();

            var max = getNextDays(15);

            var content = "<div class='room-booking-form'>\n" +
                "                        <h5 class='title'>预约看房</h5>\n" +
                "                        <form>\n" +
                "                            <div class='input-group input-group-two left-icon mb-20'>\n" +
                "                                <label for='name'>姓名</label>\n" +
                "                                <div style='margin-left: 30px' class='icon'><i class='fal fa-user'></i></div>\n" +
                "                                <input type='text' placeholder='请输入姓名' required name='name' id='name'>\n" +
                "                            </div>\n" +
                "                            <div class='input-group input-group-two left-icon mb-20'>\n" +
                "                                <label for='mobile'>手机号</label>\n" +
                "                                <div class='icon'><i class='fal fa-mobile'></i></div>\n" +
                "                                <input type='text' placeholder='请输入手机号' required name='mobile' id='mobile'>\n" +
                "                            </div>\n" +
                "                            <div class='input-group input-group-two left-icon mb-20'>\n" +
                "                                <label for='date'>预约时间</label>\n" +
                "                                <div class='icon'><i class='fal fa-calendar-alt'></i></div>\n" +
                "                                <input type='date' min='"+ min +"' max='"+ max +"' required name='date' id='date'>\n" +
                "                            </div>\n" +
                "                            <div class='input-group input-group-two left-icon mb-20'>\n" +
                "                                <div class='icon'><i class='fal fa-users'></i></div>\n" +
                "                                <label>选择中介</label>\n" +
                "                                <select name='intermediary' id='intermediary'>\n" +
                "                                " + option + " </select>\n" +
                "                            </div>\n" +
                "                            <div class='input-group input-group-two left-icon mb-20'>\n" +
                "                                <div class='icon'><i class='fal fa-users'></i></div>\n" +
                "                                <label>看房人数</label>\n" +
                "                                <select name='guest' id='guest'>\n" +
                "                                " + guest + " </select>\n" +
                "                            </div>\n" +
                "                            <div class='input-group'>\n" +
                "                                <button type='button' onclick='formSubmit()' class='main-btn btn-filled'>提交信息</button>\n" +
                "                            </div>\n" +
                "                        </form>\n" +
                "                    </div>";

            $("#order").append(content);

        }

        function formSubmit() {
            let name = $("#name").val();
            let mobile = $("#mobile").val();
            let date = $("#date").val();
            let intermediary = $("#intermediary").val();
            let guest = $("#guest").val();
            let myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
            if (name == null || name == '') {
                alert("请输入您的姓名！");
                return;
            }
            if (mobile == null || mobile == '') {
                alert("请输入您的手机号！");
                return;
            }
            if (!myreg.test(mobile)) {
                alert("请输入正确的手机号！");
                return;
            }
            if (date == null || date == '') {
                alert("请输入预约日期！");
                return;
            }
            if (new Date(date).getTime() == new Date(getNextDays(0)).getTime()) {
                alert("抱歉！今日不可预约！");
                return;
            }
            if (new Date(date).getTime() < new Date(getNextDays(0)).getTime()) {
                alert("抱歉！不能预约过去的日期！");
                returnl;
            }
            if (new Date(date).getTime() > new Date(getNextDays(15)).getTime()) {
                alert("抱歉！暂不能预约未来15天之后的日期！");
                return;
            }
            if (intermediary == null || intermediary == '') {
                alert("请选择一位中介为您服务！");
                return;
            }
            if (guest == null || guest == '') {
                alert("请选择预约看房人数！");
                return;
            }
            $.ajax({
                url: 'house-subscribe/order',
                contentType: 'application/json',
                data: JSON.stringify({
                    name : name,
                    mobile : mobile,
                    date : date,
                    intermediary : intermediary,
                    guest : guest,
                    roomId : roomId
                }),
                type: 'post',
                dataType: 'json',
                success: function (result) {
                    if (result.code == 200) {
                        alert("预约成功！请查看您的短信通知！");
                        setTimeout(toIndex(6), 3000);
                    }else if (result.code == 201) {
                        alert(result.message);
                        setTimeout(toIndex(6), 3000);
                    }else if (result.code == 501) {
                        alert(result.message);
                    }else {
                        alert("预约失败！请检查您输入的手机号！");
                    }
                }

            });
        }

        function toIndex(i) {
            setInterval(function () {
                i -= 1;
                if (i <= 0) {
                    location.href = 'index.html';
                }
                alert("感谢您的预约，请查看最新的短信通知！" + i + " 秒后将跳转主页");
            }, 1000)
        }

        function accessHits(roomId) {
            $.ajax({
                url: 'house-hits/access',
                data: {
                    roomId: roomId
                },
                type: 'post',
                dataType: 'json',
                success: function () {

                }
            });
        }

        function goHref(roomId) {
            location.href='apartment-details.html?roomId=' + roomId;
        }

        $("#search1").click(function () {
            $.ajax({
                url: 'house-room/list',
                data: {
                    pageNum : 1,
                    pageSize : 1,
                    content: $("#content1").val()
                },
                type: 'get',
                dataType: 'json',
                success: function (result) {
                    if (result.code == 200) {
                        var houseRoomList = result.data.houseRoomList;
                        if (houseRoomList.length == 0) {
                            alert("抱歉！未搜索到合适房源，请重新搜索！");
                        }else {
                            location.href = 'apartment-grid.html?search=true&content=' + encodeURI(encodeURI($("#content1").val()));
                        }
                    }
                }
            });
        });

        //获取url中的参数
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
        }

        //明天的日期
        function getTomorrowDate() {
            var nowdate = new Date();
            nowdate.setDate(nowdate.getDate() + 1);
            var y = nowdate.getFullYear();
            var m = nowdate.getMonth() + 1 < 10 ? "0" + (nowdate.getMonth() + 1) : nowdate.getMonth() + 1;
            var d = nowdate.getDate() < 10 ? "0" + nowdate.getDate() : nowdate.getDate();
            var formatwdate = y + '-' + m + '-' + d;
            return formatwdate;
        }


        function getNextDays(index) {
            var nowdate = new Date();
            nowdate.setDate(nowdate.getDate() + index);
            var y = nowdate.getFullYear();
            var m = nowdate.getMonth() + 1 < 10 ? "0" + (nowdate.getMonth() + 1) : nowdate.getMonth() + 1;
            var d = nowdate.getDate() < 10 ? "0" + nowdate.getDate() : nowdate.getDate();
            var formatwdate = y + '-' + m + '-' + d;
            return formatwdate;
        }


    </script>
</body>

</html>
